﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

namespace MDSAdministration
{
    public class EntityBuilder
    {
        public string Name { get { return TypeName + "." + PropertyName; } }
        public string TypeName { get; set; }
        public string PropertyName { get; set; }
        public void BuildEntity(Type t)
        {
            TypeName = t.Name;
            PropertyInfo[] propertyInfos = t.GetProperties();

            foreach (PropertyInfo p in propertyInfos)
            {
                PropertyName = p.Name;
                switch (p.PropertyType.ToString())
                {
                    case "System.String":
                    case "System.Int32":
                    case "System.Byte":
                    case "System.Nullable`1[System.Byte]":
                    case "System.Nullable`1[System.Int32]":
                        buildTextBoxHolder(p);
                        break;
                    case "System.Boolean":
                    case "System.Nullable`1[System.Boolean]":
                        buildCheckBoxHolder(p);
                        break;
                    default:
                        break;

                }
            }
        }
        public virtual void buildTextBoxHolder(PropertyInfo p)
        {

        }

        public virtual void buildCheckBoxHolder(PropertyInfo p)
        {

        }
    }
}
